/*!
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 *
 * Modifications Copyright OpenSearch Contributors. See
 * GitHub history for details.
 */

.ouiButtonGroup {
  display: inline-block;
  max-width: 100%;
  position: relative; // Ensures the OuiScreenReaderOnly component is positioned relative to this component
}

.ouiButtonGroup--fullWidth {
  display: block;

  .ouiButtonGroup__buttons {
    width: 100%;

    .ouiButtonGroupButton {
      flex: 1;
    }
  }
}

.ouiButtonGroup__buttons {
  @include ouiUseDefaultButtonShadows {
    @include ouiSlightShadow;
  }
  border-radius: $ouiButtonBorderRadius + 1px; // Simply for the box-shadow
  max-width: 100%;
  display: flex;
  overflow: hidden;
}

.ouiButtonGroup--isDisabled .ouiButtonGroup__buttons {
  box-shadow: none;
}

.ouiButtonGroup--compressed {
  .ouiButtonGroup__buttons {
    box-shadow: none !important; // sass-lint:disable-line no-important
    border-radius: $ouiFormControlCompressedBorderRadius;
    background-color: $ouiFormBackgroundColor;
    height: $ouiFormControlCompressedHeight;
    border: 1px solid $ouiFormBorderColor;
    overflow: visible;
  }
}

.ouiButtonGroup--vertical {
  .ouiButtonGroup__buttons {
    height: auto;
    flex-direction: column;
  }
}
